package nextoffer.didi;

import java.util.*;

public class Second {
   static Map<String, Integer> map = new HashMap<>();
   static Set<String> set = new TreeSet<>();

    public static void main(String[] args) {
        Scanner in  = new Scanner(System.in);
        int n = in.nextInt();
        String[] strings = new String[n];

        for(int i = 0 ; i < n; i++) {
            strings[i] = in.next();
            map.put(strings[i], 1);

        }
        for(int i = 0 ; i < n; i++) {
            for(int j = 0 ; j < n; j++){

                    String s = strings[i] + strings[j];
                    check(s);


            }
        }
        System.out.println(set.size());
       set.forEach(x -> System.out.println(x));


    }

    public static void check(String S) {
        List<String > l = new ArrayList<>();
        map.forEach((x, y) -> {
            if (!set.contains(x)) {
                int i = S.substring(1, S.length() - 1).indexOf(x, 1);

                if(i != -1  ){
//                    System.out.println("S = " + S);
//                    System.out.println("x = " + x);
                    l.add(x);

                    set.add(x);
                }
            }

        });
        l.forEach(x ->     map.remove(x));

    }
}
